﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace LXYYY.Migrations
{
    public partial class addtable : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<int>(
                name: "InfomationImg",
                table: "MyGoodsInformation",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.CreateTable(
                name: "Collection",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CommodityId = table.Column<int>(type: "int", nullable: false),
                    MemberId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Collection", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "OrderInfo",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderInfoId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    OrderInfoTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    PayWayInfoId = table.Column<int>(type: "int", nullable: false),
                    MemberId = table.Column<int>(type: "int", nullable: false),
                    OrderInfoAddre = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderInfoName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    ShoppAddreTel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderInfoSalePrice = table.Column<int>(type: "int", nullable: false),
                    GoodsCountPrice = table.Column<int>(type: "int", nullable: false),
                    OrderInfoBarCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderInfoPayPrice = table.Column<int>(type: "int", nullable: false),
                    OrderActivePrice = table.Column<int>(type: "int", nullable: false),
                    OrderInfoDiscount = table.Column<int>(type: "int", nullable: false),
                    OrderInfoPriviPrice = table.Column<int>(type: "int", nullable: false),
                    OrderInfoActivePrice = table.Column<int>(type: "int", nullable: false),
                    OrderInvoiceM = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    OrderWheShipments = table.Column<int>(type: "int", nullable: false),
                    OrderInfoAuditState = table.Column<int>(type: "int", nullable: false),
                    OrderInfoWhetherPay = table.Column<int>(type: "int", nullable: false),
                    OrderInfoStata = table.Column<int>(type: "int", nullable: false),
                    OrderInfoDeliveryState = table.Column<int>(type: "int", nullable: false),
                    OrderInfoWaybillNum = table.Column<int>(type: "int", nullable: false),
                    LogComId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_OrderInfo", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "OrderInfomation",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    OrderInfoId = table.Column<int>(type: "int", nullable: false),
                    CommodityId = table.Column<int>(type: "int", nullable: false),
                    SaleNumState = table.Column<int>(type: "int", nullable: false),
                    SaleNumber = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_OrderInfomation", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "ShoppingCar",
                columns: table => new
                {
                    Id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    CommodityId = table.Column<int>(type: "int", nullable: false),
                    ShoppingCartNum = table.Column<int>(type: "int", nullable: false),
                    MemberId = table.Column<int>(type: "int", nullable: false),
                    EvaluaTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ShoppingCar", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Collection");

            migrationBuilder.DropTable(
                name: "OrderInfo");

            migrationBuilder.DropTable(
                name: "OrderInfomation");

            migrationBuilder.DropTable(
                name: "ShoppingCar");

            migrationBuilder.DropColumn(
                name: "InfomationImg",
                table: "MyGoodsInformation");
        }
    }
}
